<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Futures (Guava: Google Core Libraries for Java - r09)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Futures (Guava: Google Core Libraries for Java - r09)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/common/util/concurrent/Futures.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Futures.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.common.util.concurrent</FONT>
<BR>
Class Futures</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.util.concurrent.Futures</B>
</PRE>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
</FONT>public final class <B>Futures</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Static utility methods pertaining to the <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> interface.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>1</DD>
<DT><B>Author:</B></DT>
  <DD>Kevin Bourrillion, Nishant Thakkar, Sven Mawson</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)">chain</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;input,
      <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;? extends O&gt;&gt;&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>ListenableFuture</code> whose result is asynchronously
 derived from the result of the given <code>Future</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)">chain</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;input,
      <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;? extends O&gt;&gt;&nbsp;function,
      <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A>&nbsp;exec)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>ListenableFuture</code> whose result is asynchronously
 derived from the result of the given <code>Future</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; 
<BR>
<A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateCheckedFuture(V)">immediateCheckedFuture</A></B>(V&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>CheckedFuture</code> which has its value set immediately upon
 construction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; 
<BR>
<A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFailedCheckedFuture(X)">immediateFailedCheckedFuture</A></B>(X&nbsp;exception)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>CheckedFuture</code> which has an exception set immediately upon
 construction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFailedFuture(java.lang.Throwable)">immediateFailedFuture</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A>&nbsp;throwable)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>ListenableFuture</code> which has an exception set immediately
 upon construction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#immediateFuture(V)">immediateFuture</A></B>(V&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <code>ListenableFuture</code> which has its value set immediately upon
 construction.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; 
<BR>
<A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeChecked(java.util.concurrent.Future, com.google.common.base.Function)">makeChecked</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future,
            <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,X&gt;&nbsp;mapper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> and a
 <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the
 appropriate checked type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; 
<BR>
<A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeChecked(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)">makeChecked</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt;&nbsp;future,
            <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,X&gt;&nbsp;mapper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>
 and a <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the
 appropriate checked type.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeListenable(java.util.concurrent.Future)">makeListenable</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> out of a normal <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/UninterruptibleFuture.html" title="interface in com.google.common.util.concurrent">UninterruptibleFuture</A>&lt;V&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#makeUninterruptible(java.util.concurrent.Future)">makeUninterruptible</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an uninterruptible view of a <code>Future</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;I,O&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;O&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#transform(java.util.concurrent.Future, com.google.common.base.Function)">transform</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;I&gt;&nbsp;future,
          <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>Future</code> whose result is the product of applying the
 given <code>Function</code> to the result of the given <code>Future</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#transform(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)">transform</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;future,
          <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>ListenableFuture</code> whose result is the product of
 applying the given <code>Function</code> to the result of the given <code>Future</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/common/util/concurrent/Futures.html#transform(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)">transform</A></B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;future,
          <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function,
          <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A>&nbsp;exec)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>ListenableFuture</code> whose result is the product of
 applying the given <code>Function</code> to the result of the given <code>Future</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="makeUninterruptible(java.util.concurrent.Future)"><!-- --></A><H3>
makeUninterruptible</H3>
<PRE>
public static &lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/UninterruptibleFuture.html" title="interface in com.google.common.util.concurrent">UninterruptibleFuture</A>&lt;V&gt; <B>makeUninterruptible</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future)</PRE>
<DL>
<DD>Returns an uninterruptible view of a <code>Future</code>. If a thread is
 interrupted during an attempt to <code>get()</code> from the returned future, it
 continues to wait on the result until it is available or the timeout
 elapses, and only then re-interrupts the thread.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="makeListenable(java.util.concurrent.Future)"><!-- --></A><H3>
makeListenable</H3>
<PRE>
public static &lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt; <B>makeListenable</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future)</PRE>
<DL>
<DD><p>Creates a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A> out of a normal <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A>. The
 returned future will create a thread to wait for the source future to
 complete before executing the listeners.

 <p><b>Warning:</b> If the input future does not already implement <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>, the returned future will emulate <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html#addListener(java.lang.Runnable, java.util.concurrent.Executor)"><CODE>ListenableFuture.addListener(java.lang.Runnable, java.util.concurrent.Executor)</CODE></A> by taking a thread from an internal,
 unbounded pool at the first call to <code>addListener</code> and holding it
 until the future is <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#isDone()" title="class or interface in java.util.concurrent">done</A>.

 <p>Callers who have a future that subclasses
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/FutureTask.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>FutureTask</CODE></A> may want to instead subclass
 <A HREF="../../../../../com/google/common/util/concurrent/ListenableFutureTask.html" title="class in com.google.common.util.concurrent"><CODE>ListenableFutureTask</CODE></A>, which adds the <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>
 functionality to the standard <code>FutureTask</code> implementation.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="makeChecked(java.util.concurrent.Future, com.google.common.base.Function)"><!-- --></A><H3>
makeChecked</H3>
<PRE>
public static &lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt; <B>makeChecked</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;V&gt;&nbsp;future,
                                                                     <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,X&gt;&nbsp;mapper)</PRE>
<DL>
<DD>Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>Future</CODE></A> and a
 <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the
 appropriate checked type.

 <p><b>Warning:</b> If the input future does not implement <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>, the returned future will emulate <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html#addListener(java.lang.Runnable, java.util.concurrent.Executor)"><CODE>ListenableFuture.addListener(java.lang.Runnable, java.util.concurrent.Executor)</CODE></A> by taking a thread from an internal,
 unbounded pool at the first call to <code>addListener</code> and holding it
 until the future is <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#isDone()" title="class or interface in java.util.concurrent">done</A>.

 <p>The given mapping function will be applied to an
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, a <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A>, or an
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> with the actual cause of the exception.
 See <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> for details on the exceptions thrown.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="makeChecked(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)"><!-- --></A><H3>
makeChecked</H3>
<PRE>
public static &lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt; <B>makeChecked</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt;&nbsp;future,
                                                                     <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>,X&gt;&nbsp;mapper)</PRE>
<DL>
<DD>Creates a <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent"><CODE>CheckedFuture</CODE></A> out of a normal <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>
 and a <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base"><CODE>Function</CODE></A> that maps from <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang"><CODE>Exception</CODE></A> instances into the
 appropriate checked type.

 <p>The given mapping function will be applied to an
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><CODE>InterruptedException</CODE></A>, a <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/CancellationException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>CancellationException</CODE></A>, or an
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ExecutionException</CODE></A> with the actual cause of the exception.
 See <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get()" title="class or interface in java.util.concurrent"><CODE>Future.get()</CODE></A> for details on the exceptions thrown.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
  <DD>9 (source-compatible since release 1)</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="immediateFuture(java.lang.Object)"><!-- --></A><A NAME="immediateFuture(V)"><!-- --></A><H3>
immediateFuture</H3>
<PRE>
public static &lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt; <B>immediateFuture</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
                                                      V&nbsp;value)</PRE>
<DL>
<DD>Creates a <code>ListenableFuture</code> which has its value set immediately upon
 construction. The getters just return the value. This <code>Future</code> can't
 be canceled or timed out and its <code>isDone()</code> method always returns
 <code>true</code>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="immediateCheckedFuture(java.lang.Object)"><!-- --></A><A NAME="immediateCheckedFuture(V)"><!-- --></A><H3>
immediateCheckedFuture</H3>
<PRE>
public static &lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt; <B>immediateCheckedFuture</B>(<FONT SIZE="-1"><A HREF="http://jsr-305.googlecode.com/svn/trunk/javadoc/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</A></FONT>
                                                                                V&nbsp;value)</PRE>
<DL>
<DD>Returns a <code>CheckedFuture</code> which has its value set immediately upon
 construction.

 <p>The returned <code>Future</code> can't be cancelled, and its <code>isDone()</code>
 method always returns <code>true</code>. Calling <code>get()</code> or <code>checkedGet()</code> will immediately return the provided value.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="immediateFailedFuture(java.lang.Throwable)"><!-- --></A><H3>
immediateFailedFuture</H3>
<PRE>
public static &lt;V&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;V&gt; <B>immediateFailedFuture</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</A>&nbsp;throwable)</PRE>
<DL>
<DD>Returns a <code>ListenableFuture</code> which has an exception set immediately
 upon construction.

 <p>The returned <code>Future</code> can't be cancelled, and its <code>isDone()</code>
 method always returns <code>true</code>. Calling <code>get()</code> will immediately
 throw the provided <code>Throwable</code> wrapped in an <code>ExecutionException</code>.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang">Error</A></CODE> - if the throwable is an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang"><CODE>Error</CODE></A>.</DL>
</DD>
</DL>
<HR>

<A NAME="immediateFailedCheckedFuture(java.lang.Exception)"><!-- --></A><A NAME="immediateFailedCheckedFuture(X)"><!-- --></A><H3>
immediateFailedCheckedFuture</H3>
<PRE>
public static &lt;V,X extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</A>&gt; <A HREF="../../../../../com/google/common/util/concurrent/CheckedFuture.html" title="interface in com.google.common.util.concurrent">CheckedFuture</A>&lt;V,X&gt; <B>immediateFailedCheckedFuture</B>(X&nbsp;exception)</PRE>
<DL>
<DD>Returns a <code>CheckedFuture</code> which has an exception set immediately upon
 construction.

 <p>The returned <code>Future</code> can't be cancelled, and its <code>isDone()</code>
 method always returns <code>true</code>. Calling <code>get()</code> will immediately
 throw the provided <code>Throwable</code> wrapped in an <code>ExecutionException</code>, and calling <code>checkedGet()</code> will throw the
 provided exception itself.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang">Error</A></CODE> - if the throwable is an <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Error.html?is-external=true" title="class or interface in java.lang"><CODE>Error</CODE></A>.</DL>
</DD>
</DL>
<HR>

<A NAME="chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)"><!-- --></A><H3>
chain</H3>
<PRE>
public static &lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt; <B>chain</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;input,
                                              <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;? extends O&gt;&gt;&nbsp;function)</PRE>
<DL>
<DD>Returns a new <code>ListenableFuture</code> whose result is asynchronously
 derived from the result of the given <code>Future</code>. More precisely, the
 returned <code>Future</code> takes its result from a <code>Future</code> produced by
 applying the given <code>Function</code> to the result of the original <code>Future</code>. Example:

 <pre>   <code>ListenableFuture&lt;RowKey&gt; rowKeyFuture = indexService.lookUp(query);
   Function&lt;RowKey, ListenableFuture&lt;QueryResult&gt;&gt; queryFunction =
       new Function&lt;RowKey, ListenableFuture&lt;QueryResult&gt;&gt;() {
         public ListenableFuture&lt;QueryResult&gt; apply(RowKey rowKey) {
           return dataService.read(rowKey);
         }
       };
   ListenableFuture&lt;QueryResult&gt; queryFuture =
       chain(queryFuture, queryFunction);
 </code></pre>

 <p>Successful cancellation of either the input future or the result of
 function application will cause the returned future to be cancelled.
 Cancelling the returned future will succeed if it is currently running.
 In this case, attempts will be made to cancel the input future and the
 result of the function, however there is no guarantee of success.

 <p>TODO: Add a version that accepts a normal <code>Future</code>

 <p>The typical use for this method would be when a RPC call is dependent on
 the results of another RPC.  One would call the first RPC (input), create a
 function that calls another RPC based on input's result, and then call
 chain on input and that function to get a <code>ListenableFuture</code> of
 the result.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>input</CODE> - The future to chain<DD><CODE>function</CODE> - A function to chain the results of the provided future
     to the results of the returned future.  This will be run in the thread
     that notifies input it is complete.
<DT><B>Returns:</B><DD>A future that holds result of the chain.</DL>
</DD>
</DL>
<HR>

<A NAME="chain(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)"><!-- --></A><H3>
chain</H3>
<PRE>
public static &lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt; <B>chain</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;input,
                                              <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;? extends O&gt;&gt;&nbsp;function,
                                              <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A>&nbsp;exec)</PRE>
<DL>
<DD>Returns a new <code>ListenableFuture</code> whose result is asynchronously
 derived from the result of the given <code>Future</code>. More precisely, the
 returned <code>Future</code> takes its result from a <code>Future</code> produced by
 applying the given <code>Function</code> to the result of the original <code>Future</code>. Example:

 <pre>   <code>ListenableFuture&lt;RowKey&gt; rowKeyFuture = indexService.lookUp(query);
   Function&lt;RowKey, ListenableFuture&lt;QueryResult&gt;&gt; queryFunction =
       new Function&lt;RowKey, ListenableFuture&lt;QueryResult&gt;&gt;() {
         public ListenableFuture&lt;QueryResult&gt; apply(RowKey rowKey) {
           return dataService.read(rowKey);
         }
       };
   ListenableFuture&lt;QueryResult&gt; queryFuture =
       chain(queryFuture, queryFunction, executor);
 </code></pre>

 <p>Successful cancellation of either the input future or the result of
 function application will cause the returned future to be cancelled.
 Cancelling the returned future will succeed if it is currently running.
 In this case, attempts will be made to cancel the input future and the
 result of the function, however there is no guarantee of success.

 <p>This version allows an arbitrary executor to be passed in for running
 the chained Function. When using <A HREF="../../../../../com/google/common/util/concurrent/MoreExecutors.html#sameThreadExecutor()"><CODE>MoreExecutors.sameThreadExecutor()</CODE></A>,
 the thread chained Function executes in will be whichever thread set the
 result of the input Future, which may be the network thread in the case of
 RPC-based Futures.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>input</CODE> - The future to chain<DD><CODE>function</CODE> - A function to chain the results of the provided future
     to the results of the returned future.<DD><CODE>exec</CODE> - Executor to run the function in.
<DT><B>Returns:</B><DD>A future that holds result of the chain.</DL>
</DD>
</DL>
<HR>

<A NAME="transform(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function)"><!-- --></A><H3>
transform</H3>
<PRE>
public static &lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt; <B>transform</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;future,
                                                  <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function)</PRE>
<DL>
<DD>Returns a new <code>ListenableFuture</code> whose result is the product of
 applying the given <code>Function</code> to the result of the given <code>Future</code>. Example:

 <pre>   <code>ListenableFuture&lt;QueryResult&gt; queryFuture = ...;
   Function&lt;QueryResult, List&lt;Row&gt;&gt; rowsFunction =
       new Function&lt;QueryResult, List&lt;Row&gt;&gt;() {
         public List&lt;Row&gt; apply(QueryResult queryResult) {
           return queryResult.getRows();
         }
       };
   ListenableFuture&lt;List&lt;Row&gt;&gt; rowsFuture =
       transform(queryFuture, rowsFunction);
 </code></pre>

 <p>Successful cancellation of the input future will cause the returned
 future to be cancelled.  Cancelling the returned future will succeed if it
 is currently running.  In this case, an attempt will be made to cancel the
 input future, however there is no guarantee of success.

 <p>An example use of this method is to convert a serializable object
 returned from an RPC into a POJO.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future
     to the results of the returned future.  This will be run in the thread
     that notifies input it is complete.
<DT><B>Returns:</B><DD>A future that holds result of the composition.<DT><B>Since:</B></DT>
  <DD>9 (in version 1 as <code>compose</code>)</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="transform(com.google.common.util.concurrent.ListenableFuture, com.google.common.base.Function, java.util.concurrent.Executor)"><!-- --></A><H3>
transform</H3>
<PRE>
public static &lt;I,O&gt; <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;O&gt; <B>transform</B>(<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent">ListenableFuture</A>&lt;I&gt;&nbsp;future,
                                                  <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function,
                                                  <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent">Executor</A>&nbsp;exec)</PRE>
<DL>
<DD>Returns a new <code>ListenableFuture</code> whose result is the product of
 applying the given <code>Function</code> to the result of the given <code>Future</code>. Example:

 <pre>   <code>ListenableFuture&lt;QueryResult&gt; queryFuture = ...;
   Function&lt;QueryResult, List&lt;Row&gt;&gt; rowsFunction =
       new Function&lt;QueryResult, List&lt;Row&gt;&gt;() {
         public List&lt;Row&gt; apply(QueryResult queryResult) {
           return queryResult.getRows();
         }
       };
   ListenableFuture&lt;List&lt;Row&gt;&gt; rowsFuture =
       transform(queryFuture, rowsFunction, executor);
 </code></pre>

 <p>Successful cancellation of the input future will cause the returned
 future to be cancelled.  Cancelling the returned future will succeed if it
 is currently running.  In this case, an attempt will be made to cancel the
 input future, however there is no guarantee of success.

 <p>An example use of this method is to convert a serializable object
 returned from an RPC into a POJO.

 <p>This version allows an arbitrary executor to be passed in for running
 the chained Function. When using <A HREF="../../../../../com/google/common/util/concurrent/MoreExecutors.html#sameThreadExecutor()"><CODE>MoreExecutors.sameThreadExecutor()</CODE></A>,
 the thread chained Function executes in will be whichever thread set the
 result of the input Future, which may be the network thread in the case of
 RPC-based Futures.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future
     to the results of the returned future.<DD><CODE>exec</CODE> - Executor to run the function in.
<DT><B>Returns:</B><DD>A future that holds result of the composition.<DT><B>Since:</B></DT>
  <DD>9 (in version 2 as <code>compose</code>)</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="transform(java.util.concurrent.Future, com.google.common.base.Function)"><!-- --></A><H3>
transform</H3>
<PRE>
public static &lt;I,O&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;O&gt; <B>transform</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</A>&lt;I&gt;&nbsp;future,
                                        <A HREF="../../../../../com/google/common/base/Function.html" title="interface in com.google.common.base">Function</A>&lt;? super I,? extends O&gt;&nbsp;function)</PRE>
<DL>
<DD>Returns a new <code>Future</code> whose result is the product of applying the
 given <code>Function</code> to the result of the given <code>Future</code>. Example:

 <pre>   <code>Future&lt;QueryResult&gt; queryFuture = ...;
   Function&lt;QueryResult, List&lt;Row&gt;&gt; rowsFunction =
       new Function&lt;QueryResult, List&lt;Row&gt;&gt;() {
         public List&lt;Row&gt; apply(QueryResult queryResult) {
           return queryResult.getRows();
         }
       };
   Future&lt;List&lt;Row&gt;&gt; rowsFuture = transform(queryFuture, rowsFunction);
 </code></pre>

 <p>Each call to <code>Future&lt;O&gt;.get(*)</code> results in a call to
 <code>Future&lt;I&gt;.get(*)</code>, but <code>function</code> is only applied once, so it
 is assumed that <code>Future&lt;I&gt;.get(*)</code> is idempotent.

 <p>When calling <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html?is-external=true#get(long, java.util.concurrent.TimeUnit)" title="class or interface in java.util.concurrent"><CODE>Future.get(long, TimeUnit)</CODE></A> on the returned
 future, the timeout only applies to the future passed in to this method.
 Any additional time taken by applying <code>function</code> is not considered.
 (Exception: If the input future is a <A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><CODE>ListenableFuture</CODE></A>, timeouts
 will be strictly enforced.)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>future</CODE> - The future to compose<DD><CODE>function</CODE> - A Function to compose the results of the provided future
     to the results of the returned future.  This will be run in the thread
     that calls one of the varieties of <code>get()</code>.
<DT><B>Returns:</B><DD>A future that computes result of the composition.<DT><B>Since:</B></DT>
  <DD>9 (in version 1 as <code>compose</code>)</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/common/util/concurrent/ForwardingService.html" title="class in com.google.common.util.concurrent"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/common/util/concurrent/ListenableFuture.html" title="interface in com.google.common.util.concurrent"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/common/util/concurrent/Futures.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Futures.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
